import { FilterConst } from "../../component/gconst/FilterConst";
import { EffectManager } from "./EffectManager";
type int = number;
//class HighlightManager
    
    export  class HighlightManager
    {
        constructor()
        {
            
            if (HighlightManager._instance != null) 
            {
                throw new Error("HighlightManager 单例");
            }
            return;
        }

        public initSmallMap(): void
        {
            return;
        }

        public glowEffectButton(arg1: Object /* flash.display.DisplayObject */, arg2: Boolean=true, arg3: Array<any>=null, arg4: number=1, arg5: int=10, arg6: int=0, arg7: int=0): void
        {
            if (arg2) 
            {
                if (arg1) 
                {
                    if (arg3 == null) 
                    {
                        arg3 = [FilterConst.uiBtnFilter];
                    }
                    EffectManager.glowFilterReg(arg1, arg3, arg4, arg5, arg6, arg7);
                    arg1.addEventListener(flash.events.MouseEvent.CLICK, this.onTargetClickHandler);
                }
            }
            else 
            {
                EffectManager.glowFilterUnReg(arg1);
            }
            return;
        }

        /* internal  */onTargetClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.currentTarget as Object /* flash.display.DisplayObject */;
            if (loc1) 
            {
                EffectManager.glowFilterUnReg(loc1);
                loc1.removeEventListener(flash.events.MouseEvent.CLICK, this.onTargetClickHandler);
            }
            return;
        }

        public flashMaskButton(arg1: Object /* flash.display.DisplayObject */, arg2: Boolean=true): void
        {
            if (arg2) 
            {
                if (arg1 && arg1.parent) 
                {
                    EffectManager.flashMaskReg(arg1, arg1.parent, arg1.x + arg1.width / 2, arg1.y + arg1.height / 2);
                }
            }
            else if (arg1) 
            {
                EffectManager.flashMaskUnReg(arg1);
            }
            return;
        }

        public static get instance(): HighlightManager
        {
            return HighlightManager._instance;
        }

        /* internal */ static /* var */_instance: HighlightManager;
    }

            HighlightManager._instance = new HighlightManager();
        